import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  // 数据存储
  state: {
    count: 0
  },
  mutations: {
    add (state, payload) {
      console.log(payload)
      state.count += payload
    }
  },
  actions: {
    addHandle (context, payload) {
      console.log(payload)
      context.commit('add', payload.amount)
    }
  },
  modules: {
  }
})
